package cn.itcast.service.system.impl;

import cn.itcast.dao.system.NoticeDao;
import cn.itcast.domain.system.Notice;
import cn.itcast.domain.system.NoticeExample;
import cn.itcast.service.system.NoticeService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeServiceImpl implements NoticeService {


    @Autowired
    private NoticeDao noticeDao;

    @Override
    public List<Notice> findAll(NoticeExample noticeExample) {

        return noticeDao.selectByExample(noticeExample);
    }

    @Override
    public Notice findById(String id) {

        return noticeDao.selectByPrimaryKey(id);
    }

    @Override
    public void save(Notice notice) {

        noticeDao.insertSelective(notice);
    }

    @Override
    public void update(Notice notice) {
        noticeDao.updateByPrimaryKeySelective(notice);
    }

    @Override
    public void delete(String id) {

    }

    @Override
    public PageInfo findByPage(Integer pageNum, Integer pageSize) {
        return null;
    }
}
